package edu.ccut.saturn.studio.wfg.utils;

import java.lang.reflect.Method;

import org.w3c.dom.Node;

import edu.ccut.saturn.studio.wfg.wfgmodel.SaturnAttribute;

public  class RunTime {
	public static String getValue(Object att ,String methodName){
		try {
			Method method = att.getClass().getMethod(methodName);
			return (String)(method.invoke(att));
		} catch (Exception e) {
			e.printStackTrace();
		}
		return null;
	}
	
	public static SaturnAttribute getSaturnAttribute(Object att ,Node node,String methodName){
		try {
			Method method = att.getClass().getMethod(methodName,Node.class);
			return (SaturnAttribute)(method.invoke(att,node));
		} catch (Exception e) {
			e.printStackTrace();
		}
		return null;
	}
}
